﻿<?php
	require_once("class.phpmailer.php");

	$respostas[] = '';
	foreach($_POST as $val){
		$respostas[] = $val;
	}
	$i = 1;
	for($i < 10){
		$msg .= ("0$i ".$respostas[$i]."\n");
	}
	$msg .= ("10 ".$respostas[10]."\n\n");

	$nome = $_POST['nome'];
	$email = $_POST['email'];
	$msg .= $_POST['msg'];

	$mail = new PHPMailer();

	$mail->From = $email;
	$mail->FromName = $nome;

	$mail->Subject = "Check up - fiplan.com.br";
	$mail->AddAddress("fiplan@fiplan.com.br", "FIPLAN");

	$mail->Body = "- Enviado por: $nome ($email)\n\n- $msg";

	if(!$mail->Send())
		echo "Erro: " . $mail->ErrorInfo;
	else
		echo "<script type='text/javascript'>window.location.href = '/index.shtml';</script>";
?>